<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>网页名称</title>

<style type="text/css">
#test {
	width: 300px;
}
    #demo{
        width: 50%
    }
</style>
</head>
<body>
    
	<button id="test">test</button>
    
    <center> <button id="demo">demo</button></center>
    
	<p class="x">adfdfdf</p>
    
	<script type="text/javascript" src="jquery-1.12.0.min.js"></script>
	<script >
		var s = "template";
		$("#test").on("click", function() {
			alert(s);
		});
	</script>

</body>


</html>